package com.pankaj.lifecycleexample;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends Activity {
    /** Called when the activity is first created. */
	String TAG="FirstActivity";
    @Override
    public void onCreate(Bundle savedInstanceState){
    	super.onCreate(savedInstanceState);
    	setContentView(R.layout.main);
    	Toast.makeText(this, "On Create Called In FirstActivity", Toast.LENGTH_LONG).show();
    	Log.i(TAG, "onCreate");   	 
    }   
    @Override
	protected void onStart() {
		// TODO Auto-generated method stub
		super.onStart();
		Toast.makeText(this, "On Start Called In FirstActivity", Toast.LENGTH_LONG).show();
		Log.i(TAG, "onStart");
	}   
    @Override
	protected void onResume(){
		// TODO Auto-generated method stub
		super.onResume();
		Toast.makeText(this, "On Resume Called In FirstActivity", Toast.LENGTH_LONG).show();
		Log.i(TAG, "onResume");
	} 
 @Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		Toast.makeText(this, "On Pause Called In FirstActivity", Toast.LENGTH_LONG).show();
		Log.i(TAG, "onPause");
	}
   @Override
	protected void onStop() {
		// TODO Auto-generated method stub
		super.onStop();
		
		Toast.makeText(this, "On Stop Called In FirstActivity", Toast.LENGTH_LONG).show();
		Log.i(TAG, "onStop");
	}
   @Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
		//Toast.makeText(this, "On Destroy Called In FirstActivity", Toast.LENGTH_LONG).show();
		Log.i(TAG, "onDestroy");
		
	}
   @Override
	protected void onRestart() {
		// TODO Auto-generated method stub
		super.onRestart();
		Toast.makeText(this, "On Restart Called In FirstActivity", Toast.LENGTH_LONG).show();
		Log.i(TAG, "onRestart");
	}
	public void startSecondActivity(View V){
    	// create an new Intent and Start Second Activity
    	Intent intent=new Intent(this,SecondActivity.class);
    	startActivity(intent);
	}
}
